home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swags_z.zip / STRINGS.SWG / 0039_Locate String in SUB-Str.pas < prev    next >
Pascal/Delphi Source File  |  1993-09-26  |  795b  |  18 lines

  1. {*****************************************************************************
  2.  * Function ...... InStr()
  3.  * Purpose ....... To locate a substring in a string starting at a given
  4.  *                 position.
  5.  * Parameters .... n        Position in the string to start searching
  6.  *                 sub      Substring to search for
  7.  *                 s        String to search in
  8.  * Returns ....... Numeric position of <sub> in string <s> after position <n>
  9.  * Notes ......... Uses function Right
  10.  * Author ........ Martin Richardson
  11.  * Date .......... October 2, 1992
  12.  *****************************************************************************}
  13. FUNCTION InStr( n: BYTE; sub: STRING; s: STRING ): BYTE;
  14. BEGIN
  15.      InStr := POS( sub, Right( s, LENGTH(s)-n+1 ) ) + n - 1;
  16. END;
  17.  
  18.